.TH bkvs.1 "August 16, 2011" "Version 1.0" "USER COMMANDS"
.SH NAME
bkvs \- Bash Key/Value Store

.SH SYNOPSIS
.B bkvs [\-r database] (get|set|delete) key [value]

.SH DESCRIPTION
Key/value stores are really useful, and have been gaining traction ancross many
software domains. While associative arrays are part of Bash, having a persistent
store available across sessions would be really nice. In fact, there is already
such a store available\- any POSIX filesystem. .B "bkvs" is a facade wrapping
the Key/Value operations get(key), set(key, value), and delete(key) to
appropriate file system manipulations.

There are several tradeoffs to using a normal file system for the store.

.B Why this is bad:
.IP \[bu] 2
File systems are not designed for many small files. 
.IP \[bu]
Many subshells started for some otherwise trivial operations.

.B Why this is good:
.IP \[bu] 3
Portable. Only requires some of the most common core unix utilities.
.IP \[bu]
Obvious. The directory just sits there, independent of the program.
.IP \[bu]
Scalable. Well, sort of. It's as scalable as the underlying filesystem.

.SH USAGE

.BI get( key )
Print the value of a given node to 
.I stdout
or print "" (the empty string) and return 1 if the node does not exist. If the
node has other children, lists the keys of the children.

.BI "set(" key ", " value ")"
.I value
comes from the command line, if set, or is read from
.I stdin
if not provided on the command line.

.BI delete( key )
Completely removes the node at 
.I key
and any lower nodes.

.SH OPTIONS
.IP "-r rootdir"
Overrides the root directory specified in
.B BKVS_ROOTDIR
, but must be the first argument.

.SH FILES
.I /tmp/bkvs
Default directory to maintain the store.

.SH ENVIRONMENT
.IP BKVS_ROOTDIR
The root directory to store the database in. Uses /tmp/bkvs by default.

.SH AUTHOR
Copyright (c) 2011, David Souther <davidsouther@gmail.com>
http://code.google.com/p/bkvs/
